package com.loadmore.common.base

import android.os.Bundle
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.loadmore.common.R
import com.loadmore.common.router.RouterPath

/**
 *@author sunleilei
 *@date 2018/7/18
 *@time 15:54
 *
 */
@Route(path = RouterPath.Module)
class ModuleActivity :BaseFragmentActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_module)
        val module = intent.getStringExtra("module")
        val fragment = ARouter.getInstance().build(module).navigation() as androidx.fragment.app.Fragment
        fragment.arguments = intent.extras
        supportFragmentManager.beginTransaction().add(R.id.module_container,fragment).commitAllowingStateLoss()

    }
}